package com.zx.cloud.stock.controller;


import com.zx.cloud.common.result.R;
import com.zx.cloud.stock.service.StockTblService;

import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zhaoxuan
 * @since 2021-12-22
 */
@RestController
@RequestMapping("/stock")
public class StockTblController {

    @Resource
    private StockTblService stockService;

    /**
     * 减库存
     *
     * @param commodityCode 商品代码
     * @param count         数量
     * @return
     */
    @RequestMapping(path = "/deduct")
    public R<?> deduct(String commodityCode, Integer count) {
        stockService.deduct(commodityCode, count);
        return R.ok();
    }

}

